package hello.service;

import java.math.BigDecimal;


/**
 * Created by Intellige Idea.
 * Author hiberk
 * Date 2017/5/23 10:10
 */
public abstract class BaseClass {
    public String superName = "super";

    private String name = "zhangsan";
    private int age = 13;

    {
        System.out.println("this is super block");
    }

    public BaseClass(String name, int age) {
        this.name = name;
        this.age = age;
    }

    static {
        System.out.println("this is super static block");
    }

    public BaseClass(String name) {
        System.out.println("this is super constructor");
        this.name = name;
        getName();
    }

    protected static int get() {
        return 1;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    static void method(Object... args) {
        for (Object obj:args
             ) {
            System.out.println(obj + "\t" + obj.toString() + "\t" + args);
        }
    }

    public static void main(String[] args) {
        BigDecimal a = new BigDecimal("15.00").divide(new BigDecimal("1.2"));
        System.out.println(a);
        double aa= 2.0d;
//        String bb = Double.toString(2.0f - 1.1f);
//        System.out.println(2.0-1.1);
//        System.out.println(2.0f-1.1f);
//        System.out.println(2.0d-1.1d);
        System.out.println(Integer.toBinaryString(100));
        System.out.println(Integer.toBinaryString(-100));
        System.out.println(Integer.toBinaryString(-3));
        System.out.println(Integer.toBinaryString(-1));
        System.out.println(Integer.MIN_VALUE+"\t"+Integer.MAX_VALUE);
        System.out.println(-1000>>4);
        System.out.println(1000>>4);
        int sum=0;
        for (int i =0;i<32;i++) {
            sum+=(Math.pow(2.0,i));
        }
        System.out.println((-1>>>10) + "\t" + Integer.toBinaryString(-1>>10));
        System.out.println(Integer.MAX_VALUE*2);
//        System.getProperties().list(System.out);
//        System.out.println(System.getProperty("user.name"));
//        System.out.println(System.getProperty("java.library.path"));
//        method();
//        method(new Object[]{1,2,3},3);
//        method(1,3,5);
        System.out.println(new SonClass().getClass().getResource("/"));
    }

    public void out() {
        System.out.println("this is abstract class");
    }
}
